package org.idea.qiyu.framework.nacos.store.service.controller;

import org.apache.dubbo.config.annotation.DubboReference;
import org.idea.qiyu.framework.nacos.interfaces.IStoreService;
import org.idea.qiyu.framework.nacos.interfaces.ITradeService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Author linhao
 * @Date created in 5:11 下午 2021/10/10
 */
@RestController
public class StoreController {

    @DubboReference
    private ITradeService iTradeService;

    @Resource
    private IStoreService iStoreService;

    @GetMapping(value = "/exec-dubbo")
    public String execDubbo(){
        iStoreService.getStore(10001);
        iTradeService.doTrade();
        return "success";
    }
}
